package com.nb.linkedlist;

import java.util.LinkedList;

/**
 * @author lihaoyang
 * @date 2021/12/27
 */
public class Test {

    public static void main(String[] args) {






        MyNode node01 = new MyNode(1);
        MyNode node02 = new MyNode(2);
        MyNode node03 = new MyNode(3);
        MyNode node04 = new MyNode(4);
        node01.setNext(node02);
        node02.setNext(node03);
        node03.setNext(node04);
        node04.setNext(null);


        MyNode curr = node01;
        while (curr !=null){
            System.err.println(curr.getValue());
            curr = curr.next;
        }




        //printNode(node01);

    }
    public static void printNode(MyNode node){
        if(node == null){
            return;
        }
        while (node != null){
            System.out.print(node.getValue()+" -> ");
            node = node.getNext();
        }
    }


}
